package cn.com.hori.cms.dao;

import cn.com.hori.cms.entities.ColumnAdmin;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author 刘艺
 * @date 2018/3/12 10:39
 */
public interface ColumnRepository extends JpaRepository<ColumnAdmin, Long> {

    @Query("select column from ColumnAdmin column where column.columnId=?1")
    ColumnAdmin getOneBycolumnId(String columnId);

    @Query("select column from ColumnAdmin column where column.superiorColumnId=?1")
    List<ColumnAdmin> getAllBySuperiorColumnIdEquals(String columId);
}
